/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.chl.angholt.bookproject.db;

import edu.chl.angholt.bookproject.db.entity.Book;
import edu.chl.angholt.bookproject.db.entity.Author;
import edu.chl.angholt.bookproject.db.exception.NonexistentEntityException;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Maria
 */
public class TestAlterBook {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        BookJpaCtrl bookCtrl = Database.getBookController();
        Author maria = new Author("Maria", "Sweden", "bi", "www.maria.se");
        Book b = new Book(Calendar.getInstance(), "Sy", "Andrad!!!!", "Swedich", "Publi", maria);
        Long id = Long.valueOf(451);
        b.setBookId(id);
        try {
            bookCtrl.edit(b);

        } catch (NonexistentEntityException ex) {
            Logger.getLogger(TestAlterBook.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(TestAlterBook.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
